import React, { Component } from 'react';

class App extends Component {
  handleClick=(e) => {
    // e合成事件
    console.log("1 执行render合成事件",e);
  
  }

  // vue mounted 
  componentDidMount(){
  document.getElementById("btn").addEventListener("click",function(e){
   e.stopPropagation();//阻止冒泡
    console.log("2 执行原生事件",e);
  })
  }
  render() {
    return (
      <div>
        <button onClick={this.handleClick} id="btn">+</button>
      </div>
    );
  }
}

export default App;
